<template>
  <view class="chat-container">
    
    <view class="time-tip">10:10</view>

    
    <view class="chat-item user-chat">
      <view class="message-content">
        王医生您好，请问您近期有时间来做上门随访吗？
      </view>
      <image 
        src="/static/头像5.png" 
        mode="widthFix" 
        class="avatar"
      ></image>
    </view>

    
    <view class="chat-item doctor-chat">
     <image
       src="/static/心率.png"  mode="widthFix" class="avatar"/>
      <view class="message-content">
        您好，本周四下午有空，可以安排上门随访~
      </view>
    </view>
  </view>
  
  
</template>

<style scoped>
.chat-container {
  padding: 20rpx;
  background-color: #f5f5f5; 
  min-height: 100vh;
}


.time-tip {
  text-align: center;
  font-size: 24rpx;
  color: #999;
  margin: 30rpx auto;
  padding: 8rpx 16rpx;
  background-color: #e5e5e5;
  border-radius: 12rpx;
  width: fit-content;
}


.chat-item {
  display: flex;
  margin: 20rpx 0;
  max-width: 90%; 
}


.user-chat {
  flex-direction: row;
  margin-right: auto; 
}


.doctor-chat {
  flex-direction: row-reverse;
}


.message-content {
  padding: 20rpx 24rpx;
  border-radius: 18rpx;
  font-size: 28rpx;
  line-height: 1.5;
  word-break: break-all; 
}


.user-chat .message-content {
  background-color: #ffffff; 
  border-top-left-radius: 6rpx; 
  box-shadow: 0 2rpx 4rpx rgba(0,0,0,0.05);
}

.doctor-chat .message-content {
  background-color: #95ec69; 
  border-top-right-radius: 6rpx; 
}


.avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  margin: 0 16rpx;
}
</style>